/**
 * 
 */
package com.wolfware.athsweb.persistancy.springhibernate;

import java.util.List;

import com.wolfware.athsweb.domain.User;
import com.wolfware.athsweb.persistancy.dao.UserDAO;

/**
 * Implementation of UserDAO.
 * 
 * @see UserDAO
 * @author ChristianStrzadala
 */
public class SpringHibernateUserDAOImpl extends AbstractSpringHibernateGenericDAOImpl<Long, User> implements UserDAO {

	public SpringHibernateUserDAOImpl(){
		super(User.class);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<User> getAllUsers() {
		return findAll();
	}

	/**
	 * {@inheritDoc}
	 */
	public User getUserById(Long id) {
		return read(id);
	}

	/**
	 * {@inheritDoc}
	 */
	public void saveUserEntries(List<User> UserList) {
        for (User user : UserList) {
            create(user);
        }
	}

	/**
	 * {@inheritDoc}
	 */
	public void saveUserEntry(User user) {
		create(user);
	}
	
	/**
	 * {@inheritDoc}
	 */
	public void updateUserEntry(User user) {
		update(user);
	}

	/**
	 * {@inheritDoc}
	 */
	public void deleteUserEntry(User user) {
		delete(user);
	}
}